<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/10 0010
 * Time: 下午 4:41
 */
namespace app\common\validate;

use app\lib\exception\ParameterException;

class DeliverGoods extends BaseValidate{
    protected $rule = [
        'id' => 'require|isNotEmpty',
        'deliverMethod' => 'require|checkDeliverMethod',
    ];



    protected $message = [
        'id' => '缺少订单id',
        'deliverMethod' => '配送方式必须是0、1、2',
    ];

    protected function checkDeliverMethod($value){
        if($value==0 || $value==1 || $value==2){
            return true;
        }else{
            return false;
        }
    }
}